<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let persons = [
            {
                username: '张飞',
                sex: '男',
                salary: 50000
            },
            {
                username: '关羽',
                sex: '男',
                salary: 60000
            }
        ]
        let obj=[];
        // Object.assign(obj,persons);
        // console.log(obj);

        persons.forEach(function(item,index){
            let objx={};
            Object.assign(objx,item);
            // console.log(Object.is(objx,persons));
            objx.salary+=2000;
            obj.push(objx)
            
        })
        console.log(obj);
        console.log(persons);
    </script>
</body>

</html>